// $ANTLR : "AnasintANTLR.g" -> "AnasintANTLR.java"$

package pl.prac06;

import antlr.TokenBuffer;
import antlr.TokenStreamException;
import antlr.TokenStreamIOException;
import antlr.ANTLRException;
import antlr.LLkParser;
import antlr.Token;
import antlr.TokenStream;
import antlr.RecognitionException;
import antlr.NoViableAltException;
import antlr.MismatchedTokenException;
import antlr.SemanticException;
import antlr.ParserSharedInputState;
import antlr.collections.impl.BitSet;

public class AnasintANTLR extends antlr.LLkParser       implements AnasintANTLRTokenTypes
 {

protected AnasintANTLR(TokenBuffer tokenBuf, int k) {
  super(tokenBuf,k);
  tokenNames = _tokenNames;
}

public AnasintANTLR(TokenBuffer tokenBuf) {
  this(tokenBuf,3);
}

protected AnasintANTLR(TokenStream lexer, int k) {
  super(lexer,k);
  tokenNames = _tokenNames;
}

public AnasintANTLR(TokenStream lexer) {
  this(lexer,3);
}

public AnasintANTLR(ParserSharedInputState state) {
  super(state,3);
  tokenNames = _tokenNames;
}

	public final void entrada() throws RecognitionException, TokenStreamException {
		
		
		{
		_loop101:
		do {
			if ((LA(1)==ID)) {
				antlr();
			}
			else {
				break _loop101;
			}
			
		} while (true);
		}
		match(Token.EOF_TYPE);
	}
	
	public final void antlr() throws RecognitionException, TokenStreamException {
		
		
		match(ID);
		match(DOS_PUNTOS);
		{
		_loop104:
		do {
			if ((LA(1)==ID||LA(1)==TEXTO||LA(1)==ABRE_PARENT)) {
				expresion();
			}
			else {
				break _loop104;
			}
			
		} while (true);
		}
		{
		switch ( LA(1)) {
		case MI_EOF:
		{
			match(MI_EOF);
			break;
		}
		case ABRE_LLAVE:
		case PUNTOCOMA:
		{
			break;
		}
		default:
		{
			throw new NoViableAltException(LT(1), getFilename());
		}
		}
		}
		{
		switch ( LA(1)) {
		case ABRE_LLAVE:
		{
			funciones();
			break;
		}
		case PUNTOCOMA:
		{
			break;
		}
		default:
		{
			throw new NoViableAltException(LT(1), getFilename());
		}
		}
		}
		match(PUNTOCOMA);
	}
	
	public final void expresion() throws RecognitionException, TokenStreamException {
		
		
		tipo();
		{
		_loop109:
		do {
			if ((LA(1)==LINEA)) {
				match(LINEA);
				tipo();
			}
			else {
				break _loop109;
			}
			
		} while (true);
		}
	}
	
	public final void funciones() throws RecognitionException, TokenStreamException {
		
		
		match(ABRE_LLAVE);
		{
		match(TEXTO_AUX);
		}
		match(CIERRA_LLAVE);
	}
	
	public final void tipo() throws RecognitionException, TokenStreamException {
		
		
		switch ( LA(1)) {
		case ID:
		{
			match(ID);
			break;
		}
		case TEXTO:
		{
			match(TEXTO);
			break;
		}
		case ABRE_PARENT:
		{
			operador_exp();
			break;
		}
		default:
		{
			throw new NoViableAltException(LT(1), getFilename());
		}
		}
	}
	
	public final void operador_exp() throws RecognitionException, TokenStreamException {
		
		
		match(ABRE_PARENT);
		{
		int _cnt113=0;
		_loop113:
		do {
			if ((LA(1)==ID||LA(1)==TEXTO||LA(1)==ABRE_PARENT)) {
				expresion();
			}
			else {
				if ( _cnt113>=1 ) { break _loop113; } else {throw new NoViableAltException(LT(1), getFilename());}
			}
			
			_cnt113++;
		} while (true);
		}
		match(CIERRA_PARENT);
		{
		switch ( LA(1)) {
		case OPERADOR:
		{
			match(OPERADOR);
			break;
		}
		case MI_EOF:
		case ID:
		case TEXTO:
		case ABRE_PARENT:
		case CIERRA_PARENT:
		case ABRE_LLAVE:
		case LINEA:
		case PUNTOCOMA:
		{
			break;
		}
		default:
		{
			throw new NoViableAltException(LT(1), getFilename());
		}
		}
		}
	}
	
	
	public static final String[] _tokenNames = {
		"<0>",
		"EOF",
		"<2>",
		"NULL_TREE_LOOKAHEAD",
		"NUM_REAL",
		"NUM_INTEGER",
		"\"EOF\"",
		"NUEVA_LINEA",
		"BLANCO",
		"DIGITO",
		"NUMERO",
		"LETRA",
		"ID",
		"COMENTARIO",
		"TEXTO",
		"TEXTO_AUX",
		"OPERADOR",
		"PREDICADO",
		"MENOS",
		"ABRE_PARENT",
		"CIERRA_PARENT",
		"ABRE_LLAVE",
		"CIERRA_LLAVE",
		"LINEA",
		"DOS_PUNTOS",
		"COMILLA_SIMPLE",
		"DOLAR",
		"PUNTOCOMA",
		"COMA",
		"BARRAS",
		"COMILLAS"
	};
	
	
	}
